package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.entity.YxDeviceAppUseTimeVo;
import com.ruoyi.common.utils.DateUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.YxDeviceAppUseTimeMapper;
import com.ruoyi.system.domain.YxDeviceAppUseTime;
import com.ruoyi.system.service.IYxDeviceAppUseTimeService;

/**
 * 设备应用可用时间Service业务层处理
 * 
 * @author lingyu
 * @date 2024-03-12
 */
@Service
public class YxDeviceAppUseTimeServiceImpl implements IYxDeviceAppUseTimeService 
{
    @Autowired
    private YxDeviceAppUseTimeMapper yxDeviceAppUseTimeMapper;

    /**
     * 查询设备应用可用时间
     * 
     * @param id 设备应用可用时间主键
     * @return 设备应用可用时间
     */
    @Override
    public YxDeviceAppUseTime selectYxDeviceAppUseTimeById(Long id)
    {
        return yxDeviceAppUseTimeMapper.selectYxDeviceAppUseTimeById(id);
    }

    /**
     * 查询设备应用可用时间列表
     * 
     * @param yxDeviceAppUseTime 设备应用可用时间
     * @return 设备应用可用时间
     */
    @Override
    public List<YxDeviceAppUseTime> selectYxDeviceAppUseTimeList(YxDeviceAppUseTime yxDeviceAppUseTime)
    {
        return yxDeviceAppUseTimeMapper.selectYxDeviceAppUseTimeList(yxDeviceAppUseTime);
    }

    public List<YxDeviceAppUseTimeVo> selectYxDeviceAppUseTimeVoList(@Param("deviceId") String deviceId, @Param("ids")  Long[] ids){
        return yxDeviceAppUseTimeMapper.selectYxDeviceAppUseTimeVoList(deviceId, ids);
    }

    /**
     * 新增设备应用可用时间
     * 
     * @param yxDeviceAppUseTime 设备应用可用时间
     * @return 结果
     */
    @Override
    public int insertYxDeviceAppUseTime(YxDeviceAppUseTime yxDeviceAppUseTime)
    {
        yxDeviceAppUseTime.setCreateTime(DateUtils.getNowDate());
        return yxDeviceAppUseTimeMapper.insertYxDeviceAppUseTime(yxDeviceAppUseTime);
    }

    /**
     * 修改设备应用可用时间
     * 
     * @param yxDeviceAppUseTime 设备应用可用时间
     * @return 结果
     */
    @Override
    public int updateYxDeviceAppUseTime(YxDeviceAppUseTime yxDeviceAppUseTime)
    {
        return yxDeviceAppUseTimeMapper.updateYxDeviceAppUseTime(yxDeviceAppUseTime);
    }

    /**
     * 批量删除设备应用可用时间
     * 
     * @param ids 需要删除的设备应用可用时间主键
     * @return 结果
     */
    @Override
    public int deleteYxDeviceAppUseTimeByIds(Long[] ids)
    {
        return yxDeviceAppUseTimeMapper.deleteYxDeviceAppUseTimeByIds(ids);
    }

    /**
     * 删除设备应用可用时间信息
     * 
     * @param id 设备应用可用时间主键
     * @return 结果
     */
    @Override
    public int deleteYxDeviceAppUseTimeById(Long id)
    {
        return yxDeviceAppUseTimeMapper.deleteYxDeviceAppUseTimeById(id);
    }
}
